package com.wtone.platform.gat.images.gat.controller;

import com.github.xiaoymin.knife4j.annotations.ApiSort;
import com.wtone.platform.gat.images.gat.core.BaseController;
import com.wtone.platform.gat.images.gat.core.R;
import com.wtone.platform.gat.images.gat.entity.Subscribenotifications;
import com.wtone.platform.gat.images.gat.service.ISubscribenotificationsService;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author aiLin
 * @date 2020-09-29
 * @desc:通知记录 提供者
 */
@Api(tags = "通知记录DB", value = "Subscribenotifications api")
@RestController
@ApiSort(4)
@RequestMapping("subscribenotifications")
public class SubscribenotificationsController extends BaseController
{

	@Autowired
	private ISubscribenotificationsService subscribenotificationsService;

	@ApiOperation(value = "根据卡片id查询通知记录信息" , position = 10)
	@GetMapping("get/{id}")
	public Subscribenotifications get(@PathVariable("id") String id){
		return subscribenotificationsService.selectSubscribenotificationsById(id);
	}

	@ApiOperation(value = "查询通知记录列表", position = 10)
	@ApiResponses(value = {
			@ApiResponse(code = 200, message="List结果集",response= Subscribenotifications.class),
			@ApiResponse(code = 404, message = "not found error")
	})
	@ApiImplicitParam(name = "params", value = "请求参数", required = false, paramType="path", dataType = "MAP")
	@GetMapping("list")
	public R list(Subscribenotifications subscribenotifications){
		startPage();
		return result(subscribenotificationsService.selectSubscribenotificationsList(subscribenotifications));
	}

	@ApiOperation(value = "新增通知记录", position = 1)
	@PostMapping("save")
	public R addSave(@RequestBody Subscribenotifications subscribenotifications){
		return toAjax(subscribenotificationsService.insertSubscribenotifications(subscribenotifications));
	}


	@ApiOperation(value = "修改通知记录", position = 2)
	@PostMapping("update")
	public R editSave(@RequestBody Subscribenotifications subscribenotifications){
		return toAjax(subscribenotificationsService.updateSubscribenotifications(subscribenotifications));
	}


	@ApiOperation(value = "根据卡片id删除通知记录", position = 3)
	@PostMapping("remove")
	public R remove(String ids)
	{
		return toAjax(subscribenotificationsService.deleteSubscribenotificationsByIds(ids));
	}

}
